/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package program.beans;

import java.util.Vector;

/**
 * Beans class to represent a company with id and name as attributes
 * 
 * Responsible: Patrick
 */
public class Company {

    private int id;
    private String name;

    public Company(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * Check if current company is in delivered vector
     * 
     * @param catList vector
     * @return true if current company is in delivered vector
     */
    public boolean isIn(Vector<Company> compList) {
        for (Company c : compList) {
            if (c.getId() == this.getId()) {
                return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        return name;
    }
}